/**
 * @date 11:34:39 AM
 * HomeWorkAPPServiceImpl.java
 * Administrator
 * TODO
 */
package com.qs.education.service.impl;
import org.springframework.stereotype.Service;

import com.qs.education.bean.api.ResponseBean;
import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.beans.EducationHomeWorkResponse;
import com.qs.education.bean.beans.EducationHomeWorkStudentResponse;
import com.qs.education.bean.entity.EducationHomeWork;
import com.qs.education.bean.entity.EducationHomeWorkQuestion;
import com.qs.education.bean.entity.EducationHomeWorkStudent;
import com.qs.education.bean.service.BaseService;
import com.qs.education.service.IHomeWorkAPPService;
/**
 * @class HomeWorkAPPServiceImpl	
 * @author Warren
 * @description
 * @date Nov 20, 2018 
 */
@Service
public class HomeWorkAPPServiceImpl extends BaseService implements IHomeWorkAPPService{
	
	/**
	 * @author Warren
	 * @param studentId
	 * @return ResponseListBean<EducationHomeWorkStudent>
	 * @description 根据学生id查询学生的作业列表(作业本)
	 * @date Nov 20, 2018
	 */
	@Override
	public ResponseListBean<EducationHomeWorkStudent> getListByStudentId(Long studentId) {
		ResponseListBean<EducationHomeWorkStudent> responseListBean = apiCaller.getListByStudentId(studentId);
		return responseListBean;
	}
	/**
	 * @author Warren
	 * @param homeworkId
	 * @return ResponseListBean<EducationHomeWorkQuestion>
	 * @description 根据作业id获得作业的所有题目
	 * @date Nov 22, 2018
	 */
	@Override
	public ResponseListBean<EducationHomeWorkQuestion> getALLQuestionByHomeWorkId(Long homeworkId) {
		ResponseListBean<EducationHomeWorkQuestion> responseListBean = apiCaller.getALLQuestionByHomeWorkId(homeworkId);
		return responseListBean;
	}

	/**
	 * @author Warren
	 * @param hqId 作业问题标识
	 * @param studentId 学生id
	 * @param answerId 问题选项id
	 * @return ResponseBean 
	 * @description
	 * @date Nov 22, 2018
	 */
	@Override
	public ResponseBean answerHomeWorkQuestion(Long hqId, Long studentId, Long answerId) {
		ResponseBean responseBean =  apiCaller.answerHomeWorkQuestion(hqId, studentId, answerId);
		return responseBean;
	}

	/**
	 * @author Warren
	 * @param homeworkId
	 * @param studentId
	 * @param startTime
	 * @param endTime
	 * @return ResponseBean
	 * @description 学生提交作业
	 * @date Nov 22, 2018
	 */
	@Override
	public ResponseBean studentCommitHomeWork(Long homeworkId, Long studentId,String startTime,String endTime) {
		ResponseBean responseBean =  apiCaller.studentCommitHomeWork(homeworkId, studentId, startTime, endTime);
		return responseBean;
	}
	//---------------------------------------------------------------------------------------------
	/**
	 * @Description 教师选择群组发布作业
	 * @author Leon
	 * @date   Nov 22, 2018
	 * @param  
	 * @return ResponseBean
	 */
	@Override
	public ResponseBean publishHomeWork(String questionIds, String groupIds,String lessonIds, String startTime, String endTime,String teacherId) {
		ResponseBean response = apiCaller.publishHomeWork(questionIds, groupIds,lessonIds, startTime, endTime,teacherId);
		return response;
	}
	
	/**
	 * @Description 根据教师id查询教师的发布的作业列表
	 * @author Leon
	 * @date   Nov 23, 2018
	 * @param  
	 * @return ResponseListBean<EducationHomeWork>
	 */
	@Override
	public ResponseListBean<EducationHomeWork> findHomeWorkByTeacherId(String teacherId) {
		ResponseListBean<EducationHomeWork> homeworks = apiCaller.findHomeWorkByTeacherId(teacherId);
		return homeworks;
	}
	
	/**
	 * @Description 根据作业id 查看作业概览
	 * @author Leon
	 * @date   Nov 26, 2018
	 * @param  
	 * @return EducationHomeWork
	 */
	@Override
	public EducationHomeWorkResponse findHomeWorkOverviewById(String id) {
		EducationHomeWorkResponse homeWork = apiCaller.findHomeWorkOverviewById(id);
		return homeWork;
	}
	
	/**
	 * @Description 删除作业
	 * @author Leon
	 * @date   Nov 26, 2018
	 * @param  
	 * @return ResponseBean
	 */
	@Override
	public ResponseBean deleteHomeWorkById(String id) {
		ResponseBean response = apiCaller.deleteHomeWorkById(id);
		return response;
	}
	
	/**
	 * @Description 获取学生作业概览
	 * @author Leon
	 * @date   Nov 27, 2018
	 * @param  
	 * @return EducationHomeWorkStudentResponse
	 */
	@Override
	public EducationHomeWorkStudentResponse getStudentHomeWorkOverview(String id) {
		EducationHomeWorkStudentResponse response = apiCaller.getStudentHomeWorkOverview(id);
		return response;
	}
}
